﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VehicleManagement.Models;
using VehicleManagement.Codes;
using System.Collections;

namespace VehicleManagement.ControllersServices
{
    public class MessageService
    {
        public IList<Message> GetMyMessage(Hashtable ht)
        {
            return SqlMapperManager.Instance.Get().QueryForList<Message>("SELECT_MESSAGE_BY_RECEIVERID", ht);
        }

        public IList<Message> GetMessageByID(int id)
        {
            return SqlMapperManager.Instance.Get().QueryForList<Message>("SELECT_MESSAGE_BY_ID", id);
        }

        public object InsertMessage(Message Message)
        {
            return SqlMapperManager.Instance.Get().Insert("INSERT_MESSAGE", Message);
        }
        public int UpdateMessage(Message Message)
        {
            return SqlMapperManager.Instance.Get().Update("UPDATE_MESSAGE", Message);
        }
        public int DeleteMessage(int id)
        {
            return SqlMapperManager.Instance.Get().Delete("DELETE_MESSAGE", id);
        }
    }
}